<%--
  Created by IntelliJ IDEA.
  User: ASUS
  Date: 2021/11/17
  Time: 21:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>session VS application
    </title>
</head>
<body>
<%--    <%--%>
<%--        String name1 = (String) request.getAttribute("name");--%>
<%--        String name2 = (String)pageContext.getAttribute("name");--%>
<%--        out.write("request取出来的值为：" + name1);--%>
<%--    %>--%>
<%--    <br>--%>
<%--    <%--%>
<%--        out.write("pageContext取出来的值为：" + name2);--%>
<%--    %>--%>
<%--    <%--%>
<%--        String name1 = (String) request.getAttribute("name");--%>
<%--        String name2 = (String)session.getAttribute("name");--%>
<%--        out.write("request取出来的值为：" + name1);--%>
<%--    %>--%>
<%--    <br>--%>
<%--    <%--%>
<%--        out.write("session取出来的值为：" + name2);--%>
<%--    %>--%>
<%
    String name1 = (String)session.getAttribute("name");
    String name2 = (String)application.getAttribute("name");
    out.write("session取出来的值为：" + name1);
%>
<br>
<%
    out.write("application取出来的值为：" + name2);
%>
</body>
</html>
